<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <child></child>
      <child1 onclick="a()"></child1>
    </div>
    <template id="child">
      <div>child</div>
    </template>
    <template id="child1">
      <div>child1:{{name}}</div>
    </template>
    <script src="./vue.js"></script>
    <script>
      Vue.component("child", {
        template: "#child",
      });
      let vm = new Vue({
        el: "#app",
        components: {
          child1: {
            template: "#child1",
            data() {
              return {
                name: "hell",
              };
            },
          },
        },
      });
      function a() {
        vm.$children[1].changeState();
      }
    </script>
  </body>
</html>
